package com.iso8583.util;

public class BitMap {

    public static void main(String[] arge){
        String bit_map = "7020000020C08200";
        String binary = hexString2binaryString(bit_map);
        System.out.println(binary);
    }

    public static String hexString2binaryString(String hexString) {
        if (hexString == null || hexString.length() % 2 != 0)
            return null;
        String bString = "", tmp;
        for (int i = 0; i < hexString.length(); i++)
        {
            tmp = "0000"
                    + Integer.toBinaryString(Integer.parseInt(hexString
                    .substring(i, i + 1), 16));
            bString += tmp.substring(tmp.length() - 4);
        }
        return bString;
    }
}
